# Copyright (c) 2019 Presto Labs Pte. Ltd.
# Author: donggu


# ask_qty = sum(ask_0+..ask_depth)
# bid_qty = sum(bid_0+..bid_depth)
def book_pressure(book, depth=0):
  if depth != 0:
    raise NotImplementedError('depth>0 is not implemented in prophet')

  bid_qty = book.bid0.qty
  ask_qty = book.ask0.qty

  pressure = (bid_qty + ask_qty) / bid_qty
  return pressure


__all__ = ['book_pressure']
